package com.niit.controller;

import com.niit.entity.Admin;
import com.niit.service.AdminService;
import com.niit.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpSession;

@RestController
@RequestMapping("/admin")
public class AdminController {

    private AdminService adminService;
    @Autowired
    public void setAdminService(AdminService adminService) {
        this.adminService = adminService;
    }

    //登录验证
    @PostMapping("/login")
    public Result loginStatus(Admin admin, HttpSession httpSession){
        return adminService.verityPasswd(admin,httpSession);
    }
}
